﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Data;
using MasApp.BLL;

public partial class test_users_list : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void list()
    {
        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["app"].ConnectionString);
        SqlCommand sc = new SqlCommand("select username, password from login", con);
        con.Open();
        SqlDataReader sdr = sc.ExecuteReader();
        while (sdr.Read())
        {
            Response.Write(sdr.GetString(0));
            Response.Write(":");
            Response.Write(sdr.GetString(1));
            Response.Write("<br />");
        }
        sc.CommandText = "select count(1) from login";
        sdr.Close();
        Response.Write(sc.ExecuteScalar().ToString());
        con.Close();
    }
}
